package model_share

import (
	"hft/Database/admin"
	model_utils "hft/Internal/Model/utils"
)

// 角色路由中间表
type RoleRule struct {
	RoleID uint       `gorm:"column:role_id;index"`
	Role   admin.Role `gorm:"foreignKey:RoleID;reference:ID;constraint:OnDelete:CASCADE"`
	RuleID uint       `gorm:"column:rule_id;index"`
	Rule   Rule       `gorm:"foreignKey:RuleID;reference:ID;constraint:OnDelete:CASCADE"`
}

func (e RoleRule) TableName() string {
	return model_utils.Name(e)
}
